<?php

namespace Biz\Validators\Site\Member;

use Biz\Dictionaries\TitleDict;
use Illuminate\Validation\Rule;
use Biz\Dictionaries\GenderDict;
use Biz\Dictionaries\CountryDict;
use Lumen\Validation\Validators\RequestValidator;

/**
 * SiteMemberRequest.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class ProfileValidator extends RequestValidator
{
    /**
     * Get custom rules for validator errors.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'title'             => [
                'filled',
                'string',
                'max:8',
                Rule::in(TitleDict::keys()),
            ],
            'gender'             => [
                'filled',
                'string',
                'max:8',
                Rule::in(GenderDict::keys()),
            ],
            'first_name'                => 'filled|string|max:32',
            'middle_name'               => 'filled|string|max:32',
            'last_name'                 => 'filled|string|max:32',
            'country'                   => [
                'required',
                'string',
                'max:12',
                Rule::in(CountryDict::keys()),
            ],
            'address'                   => 'filled|string|max:255',
            'affiliation'               => 'filled|string|max:128',
            'department'                => 'filled|string|max:128',
            'institution'               => 'filled|string|max:128',
            'fax_number'                => 'filled|string|max:32',
            'phone_number'              => 'filled|string|max:32',
            'mobile_number'             => 'filled|string|max:32',
        ];
    }
}
